/*
 * Marmoset Add-In for Microsoft Visual Studio
 *
 * Copyright (C) 2007, David H. Hovemeyer
 * Copyright (C) 2007, Fidel K. Estrella
 *
 * This program is free software licensed under the
 * terms of the GNU General Public License, version 2.
 * See the file "COPYING.txt" for details.
 */

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Marmoset
{
    public partial class SubmitForm : Form
    {
        //Constructor
        public SubmitForm()
        {
            //Runs the InitializeComponent method in Form1.Designer.cs.
            InitializeComponent();
        }

        //Setters for Server and Username fields. These fields should not and cannot be edited by the user
        //within the context of the form.
        public void SetServer(string serverURL)
        {
            Server.Text = serverURL;
        }

        public void SetUsername(string userName)
        {
            Username.Text = userName;
        }

        public string GetUsername()
        {
            return Username.Text;
        }

        //Getter for Password field.
        public string GetPassword()
        {
            return Password.Text;
        }

        //These methods appear to be extraneous, but remain here for posterity and to prevent possible errors.
        //TODO: See if the form can function without these methods; edit SubmitForm.designer.cs accordingly.
        private void Server_TextChanged(object sender, EventArgs e)
        {
        }

        private void Username_TextChanged(object sender, EventArgs e)
        {
        }

        private void Password_TextChanged(object sender, EventArgs e)
        {
        }

        //Actions performed when either the Submit button or Cancel button is clicked.
        private void Submit_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void Cancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}